package com.csdj.t309springboot.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

public class Topic implements Serializable {
    private Integer id;

    private String title;

    private Integer commentCount=0;

    private Boolean status=true;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date topicTime;

    private String topicUser;

    private Integer topicCategoryId;

    private String topicTag;

    private Integer niceTopic;

    private Integer browseCount=0;

    private Integer thumbsUp;

    private String content;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Date getTopicTime() {
        return topicTime;
    }

    public void setTopicTime(Date topicTime) {
        this.topicTime = topicTime;
    }

    public String getTopicUser() {
        return topicUser;
    }

    public void setTopicUser(String topicUser) {
        this.topicUser = topicUser == null ? null : topicUser.trim();
    }

    public Integer getTopicCategoryId() {
        return topicCategoryId;
    }

    public void setTopicCategoryId(Integer topicCategoryId) {
        this.topicCategoryId = topicCategoryId;
    }

    public String getTopicTag() {
        return topicTag;
    }

    public void setTopicTag(String topicTag) {
        this.topicTag = topicTag == null ? null : topicTag.trim();
    }

    public Integer getNiceTopic() {
        return niceTopic;
    }

    public void setNiceTopic(Integer niceTopic) {
        this.niceTopic = niceTopic;
    }

    public Integer getBrowseCount() {
        return browseCount;
    }

    public void setBrowseCount(Integer browseCount) {
        this.browseCount = browseCount;
    }

    public Integer getThumbsUp() {
        return thumbsUp;
    }

    public void setThumbsUp(Integer thumbsUp) {
        this.thumbsUp = thumbsUp;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Topic other = (Topic) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getCommentCount() == null ? other.getCommentCount() == null : this.getCommentCount().equals(other.getCommentCount()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getTopicTime() == null ? other.getTopicTime() == null : this.getTopicTime().equals(other.getTopicTime()))
            && (this.getTopicUser() == null ? other.getTopicUser() == null : this.getTopicUser().equals(other.getTopicUser()))
            && (this.getTopicCategoryId() == null ? other.getTopicCategoryId() == null : this.getTopicCategoryId().equals(other.getTopicCategoryId()))
            && (this.getTopicTag() == null ? other.getTopicTag() == null : this.getTopicTag().equals(other.getTopicTag()))
            && (this.getNiceTopic() == null ? other.getNiceTopic() == null : this.getNiceTopic().equals(other.getNiceTopic()))
            && (this.getBrowseCount() == null ? other.getBrowseCount() == null : this.getBrowseCount().equals(other.getBrowseCount()))
            && (this.getThumbsUp() == null ? other.getThumbsUp() == null : this.getThumbsUp().equals(other.getThumbsUp()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getCommentCount() == null) ? 0 : getCommentCount().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getTopicTime() == null) ? 0 : getTopicTime().hashCode());
        result = prime * result + ((getTopicUser() == null) ? 0 : getTopicUser().hashCode());
        result = prime * result + ((getTopicCategoryId() == null) ? 0 : getTopicCategoryId().hashCode());
        result = prime * result + ((getTopicTag() == null) ? 0 : getTopicTag().hashCode());
        result = prime * result + ((getNiceTopic() == null) ? 0 : getNiceTopic().hashCode());
        result = prime * result + ((getBrowseCount() == null) ? 0 : getBrowseCount().hashCode());
        result = prime * result + ((getThumbsUp() == null) ? 0 : getThumbsUp().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        return result;
    }
}